package com.supplychainapi.service;

import com.github.pagehelper.PageInfo;
import com.supplychainapi.common.RestResponse;
import com.supplychainapi.domain.LoginCache;
import com.supplychainapi.domain.RequestRoleAddEntity;
import com.supplychainapi.domain.RoleAuthEntity;
import com.supplychainapi.model.Tbrole;
import com.supplychainapi.param.ColTitle;

import javax.servlet.ServletException;
import java.util.List;

/**
 * 角色service
 */
public interface RoleService {
    /**
     * 角色列表
     *
     * @param loginCache
     * @param fsRoleName
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo list(LoginCache loginCache, String fsRoleName, Integer pageNum, Integer pageSize);

    /**
     * 角色列表标题
     *
     * @return
     */
    List<ColTitle> getSchema();

    /**
     * 获取角色权限
     *
     * @param loginCache
     * @param tbrole
     * @return
     */
    RoleAuthEntity getRoleAuth(LoginCache loginCache, Tbrole tbrole);

    RestResponse<RoleAuthEntity> getRoleAuthResponse(LoginCache loginCache, String roleId);

    /**
     * 新增角色
     *
     * @param loginCache
     * @param requestRoleAddEntity
     * @return
     */
    RestResponse add(LoginCache loginCache, RequestRoleAddEntity requestRoleAddEntity) throws ServletException;

    /**
     * 编辑角色
     *
     * @param loginCache
     * @param requestRoleAddEntity
     * @return
     */
    RestResponse edit(LoginCache loginCache, RequestRoleAddEntity requestRoleAddEntity);

    /**
     * 删除角色
     *
     * @param loginCache
     * @param RoleId
     * @return
     */
    RestResponse delete(LoginCache loginCache, String RoleId);
}